Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Problem

PR #488 introduced a syntax error by using the replace() function in a GitHub Actions workflow expression:

name: terminal-bench-results-${{ inputs.model_name && replace(format('{0}-{1}', inputs.model_name, github.run_id), ':', '-') || format('{0}', github.run_id) }}

GitHub Actions does not support replace() as a function in workflow expressions.

This caused the nightly workflow to fail with a syntax error.

Solution

Use a shell script step to compute the artifact name using the tr command:

- name: Set artifact name
  id: artifact-name
  run: |
    if [ -n "${{ inputs.model_name }}" ]; then
      ARTIFACT_NAME="terminal-bench-results-$(echo "${{ inputs.model_name }}-${{ github.run_id }}" | tr ':' '-')"
    else
      ARTIFACT_NAME="terminal-bench-results-${{ github.run_id }}"
    fi
    echo "name=$ARTIFACT_NAME" >> $GITHUB_OUTPUT

- name: Upload benchmark results
  uses: actions/upload-artifact@v4
  with:
    name: ${{ steps.artifact-name.outputs.name }}

This uses standard shell string manipulation which is fully supported.

Testing

The workflow syntax now validates correctly. The next nightly run should:

  • ✅ Parse successfully without syntax errors
  • ✅ Replace colons with hyphens: anthropic-claude-sonnet-4-5
  • ✅ Upload artifacts with valid names

Generated with cmux

GitHub Actions does not support the replace() function in workflow
expressions. Use a shell script step with 'tr' command instead to
replace colons with hyphens in artifact names.

This fixes the syntax error that caused the nightly workflow to fail.
@ammario ammario added this pull request to the merge queue Oct 29, 2025
Merged via the queue into main with commit 90af509 Oct 29, 2025
14 checks passed
@ammario ammario deleted the fix-tb-syntax-error branch October 29, 2025 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants